import { Controller, Get, Inject, Injectable, Param } from "@nestjs/common";
import { StudentService } from "../service/student.servce";
@Controller("student")
 export class StudentController{
    // constructor(private readonly studentService:StudentService){}
@Inject()
private studentService:StudentService
    //处理get请求
    @Get()
    findAll(){
        //直接注入studentService
        return this.studentService.findAll();
    }
    
    @Get(':id')
    findOne(@Param('id') id:string){
        return this.studentService.findOne(+id);//转number类型用+匹配

 }
}
